<?php

session_start();
if(isset($_SESSION['Name'])){
//$cmd = $_REQUEST['cmd'];

include("Design.php");
$name = $_SESSION['Name'];
Top2($name);
$rm = $_REQUEST['rm'];
if(isset($rm)){}
echo "<table><tr><th>Datum</th><th>BMI</th><th>Detail</th><th>Remove</th></tr>";
include("DB.class.php");
$DB = new DB();	
if(isset($rm)){$DB->DeleteEntry($rm);}
$rs=$DB->GetData($_SESSION['ID']);		
while ($current=mysql_fetch_array($rs)){ 
			echo "<tr>";
			echo "<td>";
			echo $current["Date"];
			echo "</td>";
			echo "<td>";
			echo number_format($current["BMI"],2);
			echo "</td>";
			echo "<td>";
			echo "<a href=\"Detailtestu.php?rm=".$current['Entry_ID']."\">Detail</a>";
			echo "</td>";
			echo "<td>";
			echo "<a href=\"Mojetesty.php?rm=".$current['Entry_ID']."\">Remove</a>";
			echo "</td>";
			echo "</tr>";			
		}
		
		echo "</table>";
		?>
</body>
</html>
<?php
}



else header('Location: index.php');